home *** CD-ROM | disk | FTP | other *** search
- package com.extensibility.app;
-
- import com.extensibility.util.Debug;
- import javax.swing.undo.AbstractUndoableEdit;
-
- public abstract class BaseEdit extends AbstractUndoableEdit {
- protected BaseDocument document;
- protected String name;
- protected boolean wasTouched;
-
- public BaseEdit(String var1) {
- this.name = var1;
- this.document = null;
- }
-
- public BaseEdit(BaseDocument var1, String var2) {
- this.name = var2;
- this.document = var1;
- this.wasTouched = this.document.isTouched();
- }
-
- public String getPresentationName() {
- return this.name;
- }
-
- public void setDocument(BaseDocument var1) {
- this.document = var1;
- this.wasTouched = this.document.isTouched();
- }
-
- public BaseDocument getDocument() {
- return this.document;
- }
-
- public void undo() {
- super.undo();
- Debug.assert(this.document != null);
- this.undoCommand();
- if (!this.wasTouched) {
- this.document.setTouched(false);
- }
-
- }
-
- public void redo() {
- super.redo();
- this.redoCommand();
- }
-
- public abstract void doCommand();
-
- public void undoCommand() {
- this.doCommand();
- }
-
- public void redoCommand() {
- this.doCommand();
- }
- }
-